
path = "C:\\Users\\hanyy\\Desktop\\abc.txt"
# file1 = open(path, "r", encoding = "UTF-8")
# list1 = file1.readlines()
# file1.close()
# print(list1)
num0 = 1
def writeText():
    try:
        file1 = open(path, "a", encoding = "UTF-8")
        file1.write("this is a test")
        file1.flush()
        num0 = 2
        num = 0/0
        return num0
    except Exception as e:
        print("error")
        return num0
    else:
        print("normal")
    finally:
        num0 = 3
        print("finally")

print(writeText())